home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / md5 / Makefile < prev    next >
Encoding:
Makefile  |  1995-05-03  |  1.7 KB  |  51 lines

  1. HCRDESTDIR=/usr/skunk
  2.  
  3. # This makefile compiles the source code for the "RSA Data Security, Inc.
  4. # MD5 Message-Digest Algorithm" as found in RFC 1321.  That code is copyrighted:
  5. #
  6. #    Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991.
  7. #    All rights reserved.
  8. #
  9. # See the source code for copyright restrictions.
  10. #
  11. # No "makefile" is provided in the RFC.
  12. # This one was written by Jim Ellis (jte@cert.org) for convenience.
  13.  
  14. # Note: a bug in mddriver causes "MD" to default to an incorrect value,
  15. # so we set it to "5" here.
  16. CFLAGS = -O -DMD=5
  17.  
  18. md5: md5c.o mddriver.o
  19.     cc -o md5 md5c.o mddriver.o
  20.  
  21. install: md5
  22.     bsdinstall -s md5 $(HCRDESTDIR)/bin
  23.  
  24. mddriver.o: global.h md5.h
  25.     cc -c $(CFLAGS) mddriver.c
  26.  
  27. md5c.o: global.h md5.h
  28.     cc -c $(CFLAGS) md5c.c
  29.  
  30. test: md5 test.rfc
  31.     -./md5 -x | diff - test.rfc > diffs 2>&1
  32.     @-if test -s diffs ; then echo '*** MD5 TEST FAILED'; cat diffs; else echo '*** MD5 Test Passed'; fi
  33.     rm -f diffs
  34.  
  35. # test.rfc is taken from Appendix 5 of RFC 1321.
  36. test.rfc:
  37.     echo 'MD5 test suite:' > test.rfc
  38.     echo 'MD5 ("") = d41d8cd98f00b204e9800998ecf8427e' >> test.rfc
  39.     echo 'MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661' >> test.rfc
  40.     echo 'MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72' >> test.rfc
  41.     echo 'MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0' >> test.rfc
  42.     echo 'MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b' >> test.rfc
  43.     echo 'MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = d174ab98d277d9f5a5611c2c9f419d9f' >> test.rfc
  44.     echo 'MD5 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") = 57edf4a22be3c955ac49da2e2107b67a' >> test.rfc
  45.  
  46. clean clobber:
  47.     rm -f *.o md5 diffs test.rfc
  48.  
  49. inst-man:
  50.     bsdinstall -c -m 444 md5.1 $(HCRDESTDIR)/man/man1
  51.